3.1.42 \(\int \csc (c+d x) \sqrt {-a+a \sin (c+d x)} \, dx\) [42]

Optimal. Leaf size=39 \[ \frac {2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {-a+a \sin (c+d x)}}\right )}{d} \]

[Out]

2*arctan(cos(d*x+c)*a^(1/2)/(-a+a*sin(d*x+c))^(1/2))*a^(1/2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2852, 210} \begin {gather*} \frac {2 \sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a \sin (c+d x)-a}}\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*Sqrt[-a + a*Sin[c + d*x]],x]

[Out]

(2*Sqrt[a]*ArcTan[(Sqrt[a]*Cos[c + d*x])/Sqrt[-a + a*Sin[c + d*x]]])/d

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 2852

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-2*(
b/f), Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c
, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rubi steps

\begin {align*} \int \csc (c+d x) \sqrt {-a+a \sin (c+d x)} \, dx &=-\frac {(2 a) \text {Subst}\left (\int \frac {1}{-a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {-a+a \sin (c+d x)}}\right )}{d}\\ &=\frac {2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {-a+a \sin (c+d x)}}\right )}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(96\) vs. \(2(39)=78\).
time = 0.05, size = 96, normalized size = 2.46 \begin {gather*} \frac {\left (\log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sqrt {a (-1+\sin (c+d x))}}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]*Sqrt[-a + a*Sin[c + d*x]],x]

[Out]

((Log[1 - Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[1 + Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])*Sqrt[a*(-1 + Si
n[c + d*x])])/(d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2]))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(69\) vs. \(2(33)=66\).
time = 1.25, size = 70, normalized size = 1.79

method result size
default \(\frac {2 \left (\sin \left (d x +c \right )-1\right ) \sqrt {-a \left (1+\sin \left (d x +c \right )\right )}\, \sqrt {a}\, \arctan \left (\frac {\sqrt {-a \left (1+\sin \left (d x +c \right )\right )}}{\sqrt {a}}\right )}{\cos \left (d x +c \right ) \sqrt {a \sin \left (d x +c \right )-a}\, d}\) \(70\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a*sin(d*x+c)-a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*(sin(d*x+c)-1)*(-a*(1+sin(d*x+c)))^(1/2)*a^(1/2)*arctan((-a*(1+sin(d*x+c)))^(1/2)/a^(1/2))/cos(d*x+c)/(a*sin
(d*x+c)-a)^(1/2)/d

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(-a+a*sin(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(a*sin(d*x + c) - a)*csc(d*x + c), x)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 223, normalized size = 5.72 \begin {gather*} \left [\frac {\sqrt {-a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} + 4 \, {\left (\cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right ) + 3\right )} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right ) - 3\right )} \sqrt {a \sin \left (d x + c\right ) - a} \sqrt {-a} - 9 \, a \cos \left (d x + c\right ) - {\left (a \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) - a\right )} \sin \left (d x + c\right ) - a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1}\right )}{2 \, d}, -\frac {\sqrt {a} \arctan \left (\frac {\sqrt {a \sin \left (d x + c\right ) - a} {\left (\sin \left (d x + c\right ) + 2\right )}}{2 \, \sqrt {a} \cos \left (d x + c\right )}\right )}{d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(-a+a*sin(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(-a)*log((a*cos(d*x + c)^3 - 7*a*cos(d*x + c)^2 + 4*(cos(d*x + c)^2 - (cos(d*x + c) + 3)*sin(d*x + c)
 - 2*cos(d*x + c) - 3)*sqrt(a*sin(d*x + c) - a)*sqrt(-a) - 9*a*cos(d*x + c) - (a*cos(d*x + c)^2 + 8*a*cos(d*x
+ c) - a)*sin(d*x + c) - a)/(cos(d*x + c)^3 + cos(d*x + c)^2 - (cos(d*x + c)^2 - 1)*sin(d*x + c) - cos(d*x + c
) - 1))/d, -sqrt(a)*arctan(1/2*sqrt(a*sin(d*x + c) - a)*(sin(d*x + c) + 2)/(sqrt(a)*cos(d*x + c)))/d]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\sin {\left (c + d x \right )} - 1\right )} \csc {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(-a+a*sin(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a*(sin(c + d*x) - 1))*csc(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (33) = 66\).
time = 0.62, size = 106, normalized size = 2.72 \begin {gather*} \frac {\sqrt {-a} \log \left (\frac {{\left | -4 \, \sqrt {2} - \frac {2 \, {\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1} - 6 \right |}}{{\left | 4 \, \sqrt {2} - \frac {2 \, {\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1} - 6 \right |}}\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(-a+a*sin(d*x+c))^(1/2),x, algorithm="giac")

[Out]

sqrt(-a)*log(abs(-4*sqrt(2) - 2*(cos(-1/4*pi + 1/2*d*x + 1/2*c) - 1)/(cos(-1/4*pi + 1/2*d*x + 1/2*c) + 1) - 6)
/abs(4*sqrt(2) - 2*(cos(-1/4*pi + 1/2*d*x + 1/2*c) - 1)/(cos(-1/4*pi + 1/2*d*x + 1/2*c) + 1) - 6))*sgn(sin(-1/
4*pi + 1/2*d*x + 1/2*c))/d

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {\sqrt {a\,\sin \left (c+d\,x\right )-a}}{\sin \left (c+d\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*sin(c + d*x) - a)^(1/2)/sin(c + d*x),x)

[Out]

int((a*sin(c + d*x) - a)^(1/2)/sin(c + d*x), x)

________________________________________________________________________________________